<?php 
/*
 module:		会员充值订单
 create_time:	2022-04-05 20:59:05
 author:		
 contact:		
*/

namespace app\api\service;
use app\api\model\ZhMatchmakerCash as ZhMatchmakerCashModel;
use think\facade\Log;
use think\exception\ValidateException;
use xhadmin\CommonService;

class ZhMatchmakerCashService extends CommonService {


	/*
 	* @Description  列表数据
 	*/
	public static function indexList($where,$limit,$page){
		try{

            $res =ZhMatchmakerCashModel::alias('c')
                ->leftjoin('zh_matchmaker ','c.m_id=zh_matchmaker.matchmaker_id')
                   ->leftjoin('zh_matchmaker_order o','o.id = c.o_id')
                 ->leftjoin('zh_matchmaker_charge ch','c.c_id = ch.id')
                ->where($where)
                ->field(" o.price,o.status,o.updatetime, o.createtime,c.id,c.price cash_price,zh_matchmaker.name  m_name,ch.entry_name,ch.comment ")
                ->order(['o.createtime' => 'desc'])
                ->paginate(['list_rows'=>$limit,'page'=>$page])
                ->toArray();


		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		return ['list'=>$res['data'],'count'=>$res['total']];
	}



}

